﻿<Window x:Class="Workbench.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:view="clr-namespace:Workbench.Presentation"
        WindowStartupLocation="CenterScreen"
        Title="Linguist's Workbench" MinWidth="700" Width="{Binding Path=WindowWidth, Mode=TwoWay}" MinHeight="600" Height="{Binding Path=WindowHeight, Mode=TwoWay}" ResizeMode="CanResize">
    <Window.Resources>
        <Style TargetType="{x:Type GroupBox}">
            <Setter Property="BorderBrush" Value="{DynamicResource {x:Static SystemColors.ControlDarkBrushKey}}"></Setter>
            <Setter Property="Padding" Value="5"></Setter>
            <Setter Property="Margin" Value="5"></Setter>
        </Style>
    </Window.Resources>
        <Grid Background="{DynamicResource {x:Static SystemColors.ControlBrushKey}}">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"></RowDefinition>
            <RowDefinition Height="*"></RowDefinition>
        </Grid.RowDefinitions>
        <view:ApplicationMenuView Grid.Row="0" DataContext="{Binding AppMenuViewModel}"></view:ApplicationMenuView>
        <TabControl IsEnabled="{Binding HasProjectOpened}" 
                        Grid.Row="1" 
                        ItemsSource="{Binding Tabs}">
            <TabControl.ItemTemplate>
                <DataTemplate>
                    <TextBlock FontSize="14" Text="{Binding Header}"/>
                </DataTemplate>
            </TabControl.ItemTemplate>
            <TabControl.Resources>
                <DataTemplate DataType="{x:Type view:ProjectViewModel}">
                    <view:ProjectView DataContext="{Binding}" />
                </DataTemplate>
                <DataTemplate DataType="{x:Type view:WordListViewModel}">
                    <view:WordListView  DataContext="{Binding}" />
                </DataTemplate>
                <DataTemplate DataType="{x:Type view:LemmatizerViewModel}">
                    <view:LemmatizerView  DataContext="{Binding}" />
                </DataTemplate>
                <DataTemplate DataType="{x:Type view:POSTaggerViewModel}">
                    <view:POSTaggerView  DataContext="{Binding}" />
                </DataTemplate>
                <DataTemplate DataType="{x:Type view:ConcordancerViewModel}">
                    <view:ConcordancerView  DataContext="{Binding}" />
                </DataTemplate>
                <DataTemplate DataType="{x:Type view:ExercisesViewModel}">
                    <view:ExercisesView  DataContext="{Binding}" />
                </DataTemplate>
            </TabControl.Resources>
            
            <TabControl.ItemContainerStyle>
                <Style TargetType="TabItem">
                    <Setter Property="IsSelected" Value="{Binding IsSelected}" />
                    <Setter Property="IsEnabled" Value="{Binding IsEnabled}" />
                </Style>
            </TabControl.ItemContainerStyle>
        </TabControl>
    </Grid>
</Window>
